package decorator;

/**
 * 设计模式:装饰者模式 -- 结构型模式
 */
public class TestMethodD {

    public static void main(String[] args) {
        ConcreteComponent c = new ConcreteComponent();
        ConcreteComponentA d1 = new ConcreteComponentA();
        ConcreteDecoratorB d2 = new ConcreteDecoratorB();
        d1.setComponent(c);
        d2.setComponent(d1);
        d2.operation();
    }
}
